<template>
  <router-view />
  <!-- <transition name="van-fade">
    <loading v-show="isShowLoadding" />
  </transition> -->
  <control ref="musicControl" v-if="musicIndex !== -1" @click="onLinkPlay">
  </control>
</template>

<script setup>
import { storeToRefs } from "pinia";
import pinia from '@/store/store'
import { useStore, useMusicStore } from '@/store/index'
const user = useStore(pinia);
import { useRoute, useRouter } from "vue-router";
import { onMounted } from 'vue'
let route = useRoute()
let router = useRouter()
const musicStore = useMusicStore();
const { musicIndex, musicList } = storeToRefs(musicStore)
musicStore.setMusicIndex(-1)
musicStore.setPlayStatus(false)
// 歌曲的状态
let onLinkPlay = () => {
  let hasArr = ['musicCenter', 'music']
  if (hasArr.includes(route.name)) {
    console.log("点击事件")
    router.push('/music/play')
  }
}

onMounted(() => {

})
  // import loading from '@/components/loading.vue'
// const { isShowLoadding } = storeToRefs(user)
// user.$patch(state => {
//   state.isShowLoadding = true
// })






</script>
<style lang="scss" scoped>

</style>
